// pages/home-page/customer-tag/customerTag.js
// pages/home-page/project/project.js
const { baseUrl } = require('../../../utils/baseUrl.js');
const app = getApp()
Page({

  /**
   * 页面的初始数据
   */
  data: {
    personalInfo: {},
    url: `https://${baseUrl}/h5/#/`
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    // const {id,fileType } = options
    const { id, fileType, from, coachingContentId = '', productId, customerId, type, path, presentationIds, scene } = options
    const permissionCodes = app.globalData.permissionCodes || []
    const hasPower = permissionCodes.includes('study_rehearse')?'1':'0'
    let url = `${this.data.url}learningDetail?id=${id}&type=learn&fileType=${fileType}&session=${wx.getStorageSync("token")}&hasPower=${hasPower}`
    console.log(url)
    // let url = `${this.data.url}study?id=${id}&type=${from}&fileType=${fileType}&session=${wx.getStorageSync("token")}&coachingContentId=${coachingContentId}&hasPower=${hasPower}`
    this.setData({
      url: url,
    })
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {
  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})